package com.feng;

import java.net.Inet4Address;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

/**
 * @author HuangSuip
 */
public class TestMain {

    public static void main(String[] args) throws SocketException {
        //f1();
        f2();
    }

    private static void f2() {
        List<String> list = new ArrayList<>();
        System.out.println(System.currentTimeMillis());
    }

    private static void f1() throws SocketException {
        for (Enumeration<NetworkInterface> i = NetworkInterface.getNetworkInterfaces(); i.hasMoreElements(); ) {
            NetworkInterface ni = i.nextElement();
            if (null != ni.getHardwareAddress()) {
                ni.getInterfaceAddresses().forEach(interfaceAddress -> {
                    if (interfaceAddress.getAddress() instanceof Inet4Address) {
                        Inet4Address inet4Address = (Inet4Address) interfaceAddress.getAddress();
                        System.out.println(inet4Address.getHostAddress());
                    }
                });
            }
        }
    }


}
